<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
      
      <head>
	    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      	<meta th:include="./common"/>
		<link rel="stylesheet" th:href="@{plugin//jQuery-Validation/css/validationEngine.jquery.css}"></link>
		<style type="text/css">
      		.form-group{
      			width: 75%;
      			margin: 7px;
      		}.col-sm-8{
      			width: 66%;
      		}
      	</style>
      </head>
   <body>
	
	<div class="panel-body" style="padding:5px">
	  
                <form class="form-horizontal m-t" id="signupForm">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">姓名：</label>
                        <div class="col-sm-8">
                            <input id="firstname" name="uname" class="form-control validate[required]" type="text"/>
                            
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">账号：</label>
                        <div class="col-sm-8">
                            <input id="username" name="username" class="form-control valid validate[required]" type="text" aria-required="true" aria-invalid="false" />
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label">密码：</label>
                        <div class="col-sm-8">
                            <input id="password" name="password" class="form-control validate[required]" type="password"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">确认密码：</label>
                        <div class="col-sm-8">
                            <input id="confirm_password" name="confirm_password" class="form-control" type="password"/>
                            <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">手机电话:</label>
                        <div class="col-sm-8">
                            <input id="phone" name="phone" class="form-control validate[required]" type="text" aria-required="true" aria-invalid="true" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">E-mail：</label>
                        <div class="col-sm-8">
                            <input id="umail" name="umail" class="form-control validate[required]" type="email"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">工号:</label>
                        <div class="col-sm-8">
                            <input id="jobNumber" name="jobNumber" class="form-control valid validate[required]" type="text" aria-required="true" aria-invalid="false" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">头像:</label>
                        <div class="col-sm-8">
                            <input id="headPortrait" name="headPortrait" class="form-control valid" type="text" aria-required="true" aria-invalid="false" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">所属组织/部门:</label>
                        <div class="col-sm-8">
                            <input id="orgname" name="orgname" class="form-control valid" type="text" aria-required="true" aria-invalid="false" />
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-3 control-label">所属角色:</label>
                        <div class="col-sm-8">
                            <input class="form-control valid" type="text" aria-required="true" aria-invalid="false" />
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-3 control-label">创建时间:</label>
                        <div class="col-sm-8">
                            <input id="hello" class="laydate-icon form-control layer-date form-control valid" type="text" aria-required="true" aria-invalid="false" />
                        </div>
                    </div>
                     <div class="form-group">
                        <label class="col-sm-3 control-label">状态:</label>
                        <div class="col-sm-8">
                            <input id="ustate" name="ustate" class="form-control valid" type="text" aria-required="true" aria-invalid="false" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label">描述:</label>
                        <div class="col-sm-8">
                            <input id="description" name="description" class="form-control valid" type="text" aria-required="true" aria-invalid="false" />
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <div class="col-sm-8 col-sm-offset-3">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" class="checkbox" id="agree" name="agree"/> 我已经认真阅读并同意《使用协议》
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-8 col-sm-offset-3"><br/>
                            <button class="btn btn-primary btn_saveUserinfo" type="button">提交</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <button class="btn btn-primary " style="margin-left: 60px" type="button">取消</button>
                        </div>
                    </div>
                </form>
            </div>
  
	
	<!-- validate -->
    <script th:src="@{plugin/jQuery-Validation/js/languages/jquery.validationEngine-zh_CN.js}" type="text/javascript"></script> 
	<script th:src="@{plugin/jQuery-Validation/js/jquery.validationEngine.js}" type="text/javascript"></script> 
    <!-- data -->
    <script th:src="@{plugin/testH/laydate/laydate.js}"></script>
	
	<script type="text/javascript">
		//外部js调用
	    laydate({
	        elem: '#hello', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
	        event: 'focus' //响应事件。如果没有传入event，则按照默认的click
	    });

	
		$(function(){
			//保存按钮
			$(".btn_saveUserinfo").click(function(){
				// 直接调用表单验证
				if(!$("#signupForm").validationEngine("validate")) return ;
				 var ser=$("#signupForm").serialize();
				 $.post("/mail/saveUserInfo",ser,function(data){
					if(data==1||data=="1"){ 
						alert("数据添加成功!");
						var ss=parent.frames['iframe4'].document.getElementById('list_UserInfo');
						var $v=$(ss); //jQuery对象 
						$v.bootstrapTable('refresh'); 
					}
				})  
			})
		})
	</script>
</body>

</html>